using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Banshee
{
    public partial class TrackViewColumnWindow : Form
    {
        DataGridViewColumnCollection columns;
        public DataGridViewColumnCollection Columns
        {
            get { return columns; }
            set { columns = value; }
        }
        public TrackViewColumnWindow()
        {
            InitializeComponent();
        }

        private void TrackViewColumnWindow_Load(object sender, EventArgs e)
        {
            if (columns != null){
                foreach (DataGridViewColumn column in columns)
                {
                    if(column.HeaderText != "Uri")
                    columnlist.Items.Add(column.HeaderText,column.Visible);
                }
            }
        }

        private void columnlist_ItemCheck(object sender, ItemCheckEventArgs e)
        {

            DataGridViewColumn col = columns[e.Index];
            if (e.NewValue == CheckState.Checked)
                col.Visible = true;
            else 
                col.Visible = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}